import java.util.Scanner;

public class main_27 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        Solution_27 solution = new Solution_27();

        System.out.println("请输入数组的元素:");
        String line = scanner.nextLine();
        String[] elements = line.split("\\s+");
        int[] nums = new int[elements.length];
        for (int i = 0; i < elements.length; i++) {
            nums[i] = Integer.parseInt(elements[i]);
        }

        System.out.print("请输入要移除的值: ");
        int val = scanner.nextInt();

        int newLength = solution.removeElement(nums, val);

        System.out.println("新数组的长度: " + newLength);
        System.out.print("修改后的数组: ");
        for (int i = 0; i < newLength; i++) {
            System.out.print(nums[i] + " ");
        }

        scanner.close();
    }
}

